import { IRouteComponentProps, useDispatch } from "umi";
import React, { useEffect, useRef, useState } from 'react'
import styles from './index.less';
import { CloseOutlined, SettingOutlined } from "@ant-design/icons/lib/icons";

const KnowledgeEditor: React.FC<IRouteComponentProps<{ id: string }>> = ({ match }) => {

    // 传入 的 id；
    //  const id = match.params.id;
    console.log(match);


    // 通过useDispatch获取dispatch
    const dispatch = useDispatch();
    // const { article, loading, recommend } = useSelector((state: { article: ArticleModelState, loading: Loading, recommend: RecommendModelState }) => {
    //     return {
    //       article: state.article,
    //       loading: state.loading,
    //       recommend: state.recommend
    //     }
    //   });

    // 获取推荐阅读数据 
    //    useEffect(() => {
    //     dispatch({
    //         type: 'recommend/getRecommend'
    //     })
    // }, [])

    //  const { pageSetting } = useSelector((state: { setting: SettingModelState }) => state.setting);

    //  let detail = pageSetting.find(item => item.path === id);
    // if (!detail) {
    //     return null;
    // }

    return <div className={styles.knowledgeEditor}>
        <div className={styles.left}>
            <div>
                <CloseOutlined />
                <div>
                    <img src="" alt="" />
                    <span>12123</span>
                </div>
                <SettingOutlined />
            </div>
            <div>
                <button>保存</button>
            </div>
            <div>
                <span>0篇文章</span>
                <button>+ 新建</button>
            </div>
        </div>
        <div className={styles.right}>
            

        </div>
    </div>
}

export default KnowledgeEditor;


